<template>
	<view>
	    <view class="page-body">
	        <view class="page-section page-section-gap">
	            <map style="width: 100%; height: 750rpx;" :latitude="latitude" :longitude="longitude" :markers="covers">
	            </map>
	        </view>
			<view class="imageView">
				<view>
					校园地图：
				</view>
				<image style="width: 100%;height: 600rpx;" src="../../static/images/map/map1.jpg" mode=""></image>
			</view>
	    </view>
	</view>
</template>

<script>
	export default {
	    data() {
	        return {
				id:0, // 使用 marker点击事件 需要填写id
	            title: 'map',
	            latitude: 40.544402,
	            longitude: 81.297202,
				height:null,
	            covers: [{
	                latitude: 40.544402,
	                longitude: 81.297202,
	                // iconPath: '../../static/map/dingwei.png',
					showlocation:true
	            }]
	        }
	    },
	    methods: {
		getlocation(){
				var _this =this
				wx.getLocation({
				    type: 'wgs84',
				    success: function (res) {
				        console.log('当前位置的经度：' + res.longitude);
				        console.log('当前位置的纬度：' + res.latitude);
						var AAA=res.longitude
						var BBB=res.latitude
						var speed =res.speed
						var accuracy =res.accuracy
						var aaa=_this.longitude
						var bbb=_this.latitude
						setInterval(function(){
							if(aaa!=AAA||bbb!=BBB){
								_this.latitude=res.latitude;
								_this.longitude=res.longitude;
								_this.covers[0].latitude=res.latitude;
								_this.covers[0].longitude=res.longitude;
							}
						},5000)
				    }
				});
			},
		},
		onLoad(){
		}
	}
</script>

<style>
	.imageView{
		margin-top: 20rpx;
	}
</style>
